package com.sun.service;

import com.alibaba.fastjson.JSON;
import com.sun.dao.pojo.params.ArticleBodyParam;
import com.sun.dao.pojo.params.ArticleParam;
import com.sun.dao.vo.TagVo;
import com.sun.dao.vo.params.CategoryVo;
import com.sun.dao.vo.params.PageParams;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

public class Test {
    public static void main(String[] args) {
        ArticleParam articleParam = new ArticleParam();

        ArticleBodyParam articleBodyParam = new ArticleBodyParam();
        articleBodyParam.setContent("人生如梦！");
        articleBodyParam.setContentHtml("<p>梦醒时分</p>");
        articleParam.setBody(articleBodyParam);

        CategoryVo categoryVo = new CategoryVo();
        categoryVo.setId(1l);
        articleParam.setCategory(categoryVo);

        articleParam.setSummary("及时行乐");

        List<TagVo> tags = new ArrayList<>();
        tags.add(new TagVo(5l,"springboot"));
        tags.add(new TagVo(6l,"spring"));

        articleParam.setTitle("孙的文章");
        String string = JSON.toJSONString(articleParam);
        System.out.println(string);


        PageParams pageParams = new PageParams();
        pageParams.setCategoryId(1l);
        pageParams.setYear("2020");
        pageParams.setMonth("06");
        System.out.println(JSON.toJSONString(pageParams));

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(simpleDateFormat.format(1523947720727L));
    }
}
